import java.io.IOException;

import com.google.code.javascribd.connection.ScribdClient;
import com.google.code.javascribd.connection.ScribdConnectionException;
import com.google.code.javascribd.type.ApiKey;
import com.google.code.javascribd.type.SessionKey;
import com.google.code.javascribd.user.Login;
import com.google.code.javascribd.user.LoginResponse;

public class LoginSnippet {

	public static void main(String[] args) throws ScribdConnectionException, IOException {

		// new instance of ScribdClient
		ScribdClient client = new ScribdClient();

		// initialize required method parameters
		ApiKey apiKey = new ApiKey("scripd_api_key");
		String username = "username";
		String password = "password";

		// initialize login method
		Login login = new Login(apiKey, username, password);

		// execute
		LoginResponse response = client.execute(login);

		// get response values e.g. the session key
		SessionKey sessionKey = response.getSessionKey();
	}

}
